<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.prime.com.tr/ui"
        xmlns:ut="http://java.sun.com/jsf/composite/components/tags">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html">
    <f:view contentType="text/html">
    <h:head>
        <title>Аукционы, проходящие в настоящее время</title>
    </h:head>
    <h:body>
        <h:form>
            <h:outputLabel value="Добрый день, #{mainPage.userName}"/>
            <br/>
            <h:outputText value="#{thingBean.message}" />
            <p:dataTable value="#{lotsExplorer.activeLots}" var="lot" selectionMode="single" selection="#{thingBean.lot}">

                <p:column>
                    <f:facet name="header">
                        <h:outputText value="Продавец" />
                    </f:facet>
                    <h:outputText value="#{lot.seller.name}" />
                </p:column>

                <p:column>
                    <f:facet name="header">
                        <h:outputText value="Тип предмета" />
                    </f:facet>
                    <h:outputText value="#{lot.thing.thingType.name}" />
                </p:column>

                <p:column>
                    <f:facet name="header">
                        <h:outputText value="Подробная характериcтика" />
                    </f:facet>
                    <h:outputText value="#{lot.thing.additionalOption}" />
                </p:column>

                <p:column>
                    <f:facet name="header">
                        <h:outputText value="Последняя ставка от" />
                    </f:facet>
                    <p:outputPanel rendered="#{lot.successful}">
                        <h:outputText value="#{lot.winner.name}" />
                    </p:outputPanel>
                </p:column>

                <p:column>
                    <f:facet name="header">
                        <h:outputText value="Время последней ставки" />
                    </f:facet>
                    <p:outputPanel rendered="#{lot.successful}">
                        <h:outputText value="#{lot.winnersBid.date}" />
                    </p:outputPanel>
                </p:column>

                <p:column>
                    <f:facet name="header">
                        <h:outputText value="Текущая цена" />
                    </f:facet>
                    <p:outputPanel rendered="#{lot.successful}">
                        <h:outputText value="#{lot.winnersBid.price}" />
                    </p:outputPanel>
                </p:column>


                <f:facet name="footer" >
                    <h:commandButton id="goToThingPage"  value="Подробная информация" action="#{lotsExplorer.goToThingPage}" />
                </f:facet>

            </p:dataTable>
        </h:form>
    </h:body>
    </f:view>
</html>

</ui:composition>

